package com.liujun.spring4.demo.aop.iocset.beanConfig.configuration;

import com.liujun.spring4.demo.aop.iocset.beanConfig.configuration.service.LogonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;

/**
 * 进行数据的配制
 *
 * @author liujun
 * @version 1.0
 * @date 2018-08-20 18:09:00
 */
@Configurable
@Import(DaoConfig.class)
public class ServiceConfig2 {

  @Autowired
  private DaoConfig daoConfig;

  @Bean
  public LogonService logonService() {
    LogonService logonService = new LogonService();

    logonService.setUserDao(daoConfig.userDao());
    logonService.setLogDao(daoConfig.logDao());

    return logonService;
  }
}
